using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.Text;

namespace Data_Access_Tier
{
	public class HRM_CANDIDATE_RATEData : DatabaseObjectBase
	{
		public HRM_CANDIDATE_RATEData()
		{
			Initialize(true);
		}
		public HRM_CANDIDATE_RATEData(Boolean newConnection)
		{
			Initialize(newConnection);
		}

		public Int32 HRM_CANDIDATE_RATE_Insert(Guid RateID, String CandidateCode, String Person, DateTime Date, String Position, String Look, String Style, String Voice, String Health, String Knowledge, String Experience, String Communicate, String Solve, String Team, String Situation, String Lead, String Information, String Rate, String Proposal, Double Mark, Boolean IsPass)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.InsertCommand = new SqlCommand("HRM_CANDIDATE_RATE_Insert");
				_dbadapter.InsertCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.InsertCommand.Connection = _dbconn;
				_trans = _dbconn.BeginTransaction();
				_dbadapter.InsertCommand.Transaction = _trans;
				_dbadapter.InsertCommand.Parameters.Clear();
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@RateID", SqlDbType.UniqueIdentifier));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@CandidateCode", SqlDbType.VarChar, 20));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@Person", SqlDbType.NVarChar, 100));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@Date", SqlDbType.DateTime));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@Position", SqlDbType.NVarChar, 100));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@Look", SqlDbType.NVarChar, 255));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@Style", SqlDbType.NVarChar, 255));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@Voice", SqlDbType.NVarChar, 255));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@Health", SqlDbType.NVarChar, 255));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@Knowledge", SqlDbType.NVarChar, 255));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@Experience", SqlDbType.NVarChar, 255));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@Communicate", SqlDbType.NVarChar, 255));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@Solve", SqlDbType.NVarChar, 255));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@Team", SqlDbType.NVarChar, 255));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@Situation", SqlDbType.NVarChar, 255));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@Lead", SqlDbType.NVarChar, 255));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@Information", SqlDbType.NVarChar, 1000));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@Rate", SqlDbType.NVarChar, 255));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@Proposal", SqlDbType.NVarChar, 255));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@Mark", SqlDbType.Float));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@IsPass", SqlDbType.Bit));
				_dbadapter.InsertCommand.Prepare();
				SqlGuid RateIDSQL = RateID;
				_dbadapter.InsertCommand.Parameters["@RateID"].Value = RateIDSQL;
				SqlString CandidateCodeSQL = CandidateCode;
				_dbadapter.InsertCommand.Parameters["@CandidateCode"].Value = CandidateCodeSQL;
				SqlString PersonSQL = Person;
				_dbadapter.InsertCommand.Parameters["@Person"].Value = PersonSQL;
				SqlDateTime DateSQL = SqlDateTime.Null;
				if (Date > DateTime.MinValue)
				{
					try
					{
						DateSQL = Date;
					}
					catch (Exception eDate)
					{
						String DateMessage = eDate.Message;
						DateSQL = SqlDateTime.Null;
					}
				}
				_dbadapter.InsertCommand.Parameters["@Date"].Value = DateSQL;
				SqlString PositionSQL = Position;
				_dbadapter.InsertCommand.Parameters["@Position"].Value = PositionSQL;
				SqlString LookSQL = Look;
				_dbadapter.InsertCommand.Parameters["@Look"].Value = LookSQL;
				SqlString StyleSQL = Style;
				_dbadapter.InsertCommand.Parameters["@Style"].Value = StyleSQL;
				SqlString VoiceSQL = Voice;
				_dbadapter.InsertCommand.Parameters["@Voice"].Value = VoiceSQL;
				SqlString HealthSQL = Health;
				_dbadapter.InsertCommand.Parameters["@Health"].Value = HealthSQL;
				SqlString KnowledgeSQL = Knowledge;
				_dbadapter.InsertCommand.Parameters["@Knowledge"].Value = KnowledgeSQL;
				SqlString ExperienceSQL = Experience;
				_dbadapter.InsertCommand.Parameters["@Experience"].Value = ExperienceSQL;
				SqlString CommunicateSQL = Communicate;
				_dbadapter.InsertCommand.Parameters["@Communicate"].Value = CommunicateSQL;
				SqlString SolveSQL = Solve;
				_dbadapter.InsertCommand.Parameters["@Solve"].Value = SolveSQL;
				SqlString TeamSQL = Team;
				_dbadapter.InsertCommand.Parameters["@Team"].Value = TeamSQL;
				SqlString SituationSQL = Situation;
				_dbadapter.InsertCommand.Parameters["@Situation"].Value = SituationSQL;
				SqlString LeadSQL = Lead;
				_dbadapter.InsertCommand.Parameters["@Lead"].Value = LeadSQL;
				SqlString InformationSQL = Information;
				_dbadapter.InsertCommand.Parameters["@Information"].Value = InformationSQL;
				SqlString RateSQL = Rate;
				_dbadapter.InsertCommand.Parameters["@Rate"].Value = RateSQL;
				SqlString ProposalSQL = Proposal;
				_dbadapter.InsertCommand.Parameters["@Proposal"].Value = ProposalSQL;
				SqlDouble MarkSQL = Mark;
				_dbadapter.InsertCommand.Parameters["@Mark"].Value = MarkSQL;
				SqlBoolean IsPassSQL = IsPass;
				_dbadapter.InsertCommand.Parameters["@IsPass"].Value = IsPassSQL;
				Int32 returnvalue = Convert.ToInt32(_dbadapter.InsertCommand.ExecuteScalar());

				_trans.Commit();
				return returnvalue;
			}
			catch (SqlException e)
			{
				try
				{
					_trans.Rollback();
				}
				catch (SqlException ex)
				{
					throw new Exception("SQL Rollback Error: HRM_CANDIDATE_RATE_Insert: " + ex.Message, ex);
				}
				throw new Exception("SQL Error: HRM_CANDIDATE_RATE_Insert: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.InsertCommand != null)
					_dbadapter.InsertCommand.Dispose();
				CloseConnection();
			}
		}
		public Int32 HRM_CANDIDATE_RATE_Update(Guid RateID, String CandidateCode, String Person, DateTime Date, String Position, String Look, String Style, String Voice, String Health, String Knowledge, String Experience, String Communicate, String Solve, String Team, String Situation, String Lead, String Information, String Rate, String Proposal, Double Mark, Boolean IsPass)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.UpdateCommand = new SqlCommand("HRM_CANDIDATE_RATE_Update");
				_dbadapter.UpdateCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.UpdateCommand.Connection = _dbconn;

				_trans = _dbconn.BeginTransaction();
				_dbadapter.UpdateCommand.Transaction = _trans;

				_dbadapter.UpdateCommand.Parameters.Clear();
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@RateID", SqlDbType.UniqueIdentifier));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@CandidateCode", SqlDbType.VarChar, 20));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Person", SqlDbType.NVarChar, 100));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Date", SqlDbType.DateTime));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Position", SqlDbType.NVarChar, 100));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Look", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Style", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Voice", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Health", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Knowledge", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Experience", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Communicate", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Solve", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Team", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Situation", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Lead", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Information", SqlDbType.NVarChar, 1000));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Rate", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Proposal", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Mark", SqlDbType.Float));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@IsPass", SqlDbType.Bit));
				_dbadapter.UpdateCommand.Prepare();
				SqlGuid RateIDSQL = RateID;
				_dbadapter.UpdateCommand.Parameters["@RateID"].Value = RateIDSQL;
				SqlString CandidateCodeSQL = CandidateCode;
				_dbadapter.UpdateCommand.Parameters["@CandidateCode"].Value = CandidateCodeSQL;
				SqlString PersonSQL = Person;
				_dbadapter.UpdateCommand.Parameters["@Person"].Value = PersonSQL;
				SqlDateTime DateSQL = SqlDateTime.Null;
				if (Date > DateTime.MinValue)
				{
					try
					{
						DateSQL = Date;
					}
					catch (Exception eDate)
					{
						String DateMessage = eDate.Message;
						DateSQL = SqlDateTime.Null;
					}
				}
				_dbadapter.UpdateCommand.Parameters["@Date"].Value = DateSQL;
				SqlString PositionSQL = Position;
				_dbadapter.UpdateCommand.Parameters["@Position"].Value = PositionSQL;
				SqlString LookSQL = Look;
				_dbadapter.UpdateCommand.Parameters["@Look"].Value = LookSQL;
				SqlString StyleSQL = Style;
				_dbadapter.UpdateCommand.Parameters["@Style"].Value = StyleSQL;
				SqlString VoiceSQL = Voice;
				_dbadapter.UpdateCommand.Parameters["@Voice"].Value = VoiceSQL;
				SqlString HealthSQL = Health;
				_dbadapter.UpdateCommand.Parameters["@Health"].Value = HealthSQL;
				SqlString KnowledgeSQL = Knowledge;
				_dbadapter.UpdateCommand.Parameters["@Knowledge"].Value = KnowledgeSQL;
				SqlString ExperienceSQL = Experience;
				_dbadapter.UpdateCommand.Parameters["@Experience"].Value = ExperienceSQL;
				SqlString CommunicateSQL = Communicate;
				_dbadapter.UpdateCommand.Parameters["@Communicate"].Value = CommunicateSQL;
				SqlString SolveSQL = Solve;
				_dbadapter.UpdateCommand.Parameters["@Solve"].Value = SolveSQL;
				SqlString TeamSQL = Team;
				_dbadapter.UpdateCommand.Parameters["@Team"].Value = TeamSQL;
				SqlString SituationSQL = Situation;
				_dbadapter.UpdateCommand.Parameters["@Situation"].Value = SituationSQL;
				SqlString LeadSQL = Lead;
				_dbadapter.UpdateCommand.Parameters["@Lead"].Value = LeadSQL;
				SqlString InformationSQL = Information;
				_dbadapter.UpdateCommand.Parameters["@Information"].Value = InformationSQL;
				SqlString RateSQL = Rate;
				_dbadapter.UpdateCommand.Parameters["@Rate"].Value = RateSQL;
				SqlString ProposalSQL = Proposal;
				_dbadapter.UpdateCommand.Parameters["@Proposal"].Value = ProposalSQL;
				SqlDouble MarkSQL = Mark;
				_dbadapter.UpdateCommand.Parameters["@Mark"].Value = MarkSQL;
				SqlBoolean IsPassSQL = IsPass;
				_dbadapter.UpdateCommand.Parameters["@IsPass"].Value = IsPassSQL;
				Int32 returnvalue = Convert.ToInt32(_dbadapter.UpdateCommand.ExecuteScalar());

				_trans.Commit();
				return returnvalue;
			}
			catch (SqlException e)
			{
				try
				{
					_trans.Rollback();
				}
				catch (SqlException ex)
				{
					throw new Exception("SQL Rollback Error: HRM_CANDIDATE_RATE_Update: " + ex.Message, ex);
				}
				throw new Exception("SQL Error: HRM_CANDIDATE_RATE_Update: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.UpdateCommand != null)
					_dbadapter.UpdateCommand.Dispose();
				CloseConnection();
			}
		}
		public Int32 HRM_CANDIDATE_RATE_Disable(Guid RateID, ref Boolean Enabled)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.UpdateCommand = new SqlCommand("HRM_CANDIDATE_RATE_Disable");
				_dbadapter.UpdateCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.UpdateCommand.Connection = _dbconn;

				_trans = _dbconn.BeginTransaction();
				_dbadapter.UpdateCommand.Transaction = _trans;

				_dbadapter.UpdateCommand.Parameters.Clear();
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@RateID", SqlDbType.UniqueIdentifier));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@enabled", SqlDbType.Bit));
				_dbadapter.UpdateCommand.Prepare();
				SqlGuid RateIDSQL = RateID;
				_dbadapter.UpdateCommand.Parameters["@RateID"].Value = RateIDSQL;
				_dbadapter.UpdateCommand.Parameters["@enabled"].Direction = ParameterDirection.Output;
				Int32 returnvalue = Convert.ToInt32(_dbadapter.UpdateCommand.ExecuteScalar());

				_trans.Commit();
				return returnvalue;
			}
			catch (SqlException e)
			{
				try
				{
					_trans.Rollback();
				}
				catch (SqlException ex)
				{
					throw new Exception("SQL Rollback Error: HRM_CANDIDATE_RATE_Disable: " + ex.Message, ex);
				}
				throw new Exception("SQL Error: HRM_CANDIDATE_RATE_Disable: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.UpdateCommand != null)
					_dbadapter.UpdateCommand.Dispose();
				CloseConnection();
			}
		}
		public Int32 HRM_CANDIDATE_RATE_Delete(Guid RateID)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.DeleteCommand = new SqlCommand("HRM_CANDIDATE_RATE_Delete");
				_dbadapter.DeleteCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.DeleteCommand.Connection = _dbconn;

				_trans = _dbconn.BeginTransaction();
				_dbadapter.DeleteCommand.Transaction = _trans;

				_dbadapter.DeleteCommand.Parameters.Clear();
				_dbadapter.DeleteCommand.Parameters.Add(new SqlParameter("@RateID", SqlDbType.UniqueIdentifier));
				_dbadapter.DeleteCommand.Prepare();
				SqlGuid RateIDSQL = RateID;
				_dbadapter.DeleteCommand.Parameters["@RateID"].Value = RateIDSQL;
				Int32 returnvalue = Convert.ToInt32(_dbadapter.DeleteCommand.ExecuteScalar());

				_trans.Commit();
				return returnvalue;
			}
			catch (SqlException e)
			{
				try
				{
					_trans.Rollback();
				}
				catch (SqlException ex)
				{
					throw new Exception("SQL Rollback Error: HRM_CANDIDATE_RATE_Delete: " + ex.Message, ex);
				}
				throw new Exception("SQL Error: HRM_CANDIDATE_RATE_Delete: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.DeleteCommand != null)
					_dbadapter.DeleteCommand.Dispose();
				CloseConnection();
			}
		}
		public Int32 HRM_CANDIDATE_RATE_Save(Guid RateID, String CandidateCode, String Person, DateTime Date, String Position, String Look, String Style, String Voice, String Health, String Knowledge, String Experience, String Communicate, String Solve, String Team, String Situation, String Lead, String Information, String Rate, String Proposal, Double Mark, Boolean IsPass)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.UpdateCommand = new SqlCommand("HRM_CANDIDATE_RATE_Save");
				_dbadapter.UpdateCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.UpdateCommand.Connection = _dbconn;

				_trans = _dbconn.BeginTransaction();
				_dbadapter.UpdateCommand.Transaction = _trans;

				_dbadapter.UpdateCommand.Parameters.Clear();
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@RateID", SqlDbType.UniqueIdentifier));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@CandidateCode", SqlDbType.VarChar, 20));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Person", SqlDbType.NVarChar, 100));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Date", SqlDbType.DateTime));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Position", SqlDbType.NVarChar, 100));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Look", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Style", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Voice", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Health", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Knowledge", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Experience", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Communicate", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Solve", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Team", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Situation", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Lead", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Information", SqlDbType.NVarChar, 1000));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Rate", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Proposal", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Mark", SqlDbType.Float));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@IsPass", SqlDbType.Bit));
				_dbadapter.UpdateCommand.Prepare();
				SqlGuid RateIDSQL = RateID;
				_dbadapter.UpdateCommand.Parameters["@RateID"].Value = RateIDSQL;
				SqlString CandidateCodeSQL = CandidateCode;
				_dbadapter.UpdateCommand.Parameters["@CandidateCode"].Value = CandidateCodeSQL;
				SqlString PersonSQL = Person;
				_dbadapter.UpdateCommand.Parameters["@Person"].Value = PersonSQL;
				SqlDateTime DateSQL = SqlDateTime.Null;
				if (Date > DateTime.MinValue)
				{
					try
					{
						DateSQL = Date;
					}
					catch (Exception eDate)
					{
						String DateMessage = eDate.Message;
						DateSQL = SqlDateTime.Null;
					}
				}
				_dbadapter.UpdateCommand.Parameters["@Date"].Value = DateSQL;
				SqlString PositionSQL = Position;
				_dbadapter.UpdateCommand.Parameters["@Position"].Value = PositionSQL;
				SqlString LookSQL = Look;
				_dbadapter.UpdateCommand.Parameters["@Look"].Value = LookSQL;
				SqlString StyleSQL = Style;
				_dbadapter.UpdateCommand.Parameters["@Style"].Value = StyleSQL;
				SqlString VoiceSQL = Voice;
				_dbadapter.UpdateCommand.Parameters["@Voice"].Value = VoiceSQL;
				SqlString HealthSQL = Health;
				_dbadapter.UpdateCommand.Parameters["@Health"].Value = HealthSQL;
				SqlString KnowledgeSQL = Knowledge;
				_dbadapter.UpdateCommand.Parameters["@Knowledge"].Value = KnowledgeSQL;
				SqlString ExperienceSQL = Experience;
				_dbadapter.UpdateCommand.Parameters["@Experience"].Value = ExperienceSQL;
				SqlString CommunicateSQL = Communicate;
				_dbadapter.UpdateCommand.Parameters["@Communicate"].Value = CommunicateSQL;
				SqlString SolveSQL = Solve;
				_dbadapter.UpdateCommand.Parameters["@Solve"].Value = SolveSQL;
				SqlString TeamSQL = Team;
				_dbadapter.UpdateCommand.Parameters["@Team"].Value = TeamSQL;
				SqlString SituationSQL = Situation;
				_dbadapter.UpdateCommand.Parameters["@Situation"].Value = SituationSQL;
				SqlString LeadSQL = Lead;
				_dbadapter.UpdateCommand.Parameters["@Lead"].Value = LeadSQL;
				SqlString InformationSQL = Information;
				_dbadapter.UpdateCommand.Parameters["@Information"].Value = InformationSQL;
				SqlString RateSQL = Rate;
				_dbadapter.UpdateCommand.Parameters["@Rate"].Value = RateSQL;
				SqlString ProposalSQL = Proposal;
				_dbadapter.UpdateCommand.Parameters["@Proposal"].Value = ProposalSQL;
				SqlDouble MarkSQL = Mark;
				_dbadapter.UpdateCommand.Parameters["@Mark"].Value = MarkSQL;
				SqlBoolean IsPassSQL = IsPass;
				_dbadapter.UpdateCommand.Parameters["@IsPass"].Value = IsPassSQL;
				Int32 returnvalue = Convert.ToInt32(_dbadapter.UpdateCommand.ExecuteScalar());

				_trans.Commit();
				return returnvalue;
			}
			catch (SqlException e)
			{
				try
				{
					_trans.Rollback();
				}
				catch (SqlException ex)
				{
					throw new Exception("SQL Rollback Error: HRM_CANDIDATE_RATE_Save: " + ex.Message, ex);
				}
				throw new Exception("SQL Error: HRM_CANDIDATE_RATE_Save: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.UpdateCommand != null)
					_dbadapter.UpdateCommand.Dispose();
				CloseConnection();
			}
		}
		public DataSet HRM_CANDIDATE_RATE_GetList()
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.SelectCommand = new SqlCommand("HRM_CANDIDATE_RATE_GetList");
				_dbadapter.SelectCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.SelectCommand.Connection = _dbconn;
				_dbadapter.SelectCommand.Parameters.Clear();
				_dbadapter.SelectCommand.Prepare();
				_dbadapter.Fill(_data);

				return _data;
			}
			catch (SqlException e)
			{
				throw new Exception("SQL Error: HRM_CANDIDATE_RATE_GetList: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.SelectCommand != null)
					_dbadapter.SelectCommand.Dispose();
				CloseConnection();
			}
		}
		public DataSet HRM_CANDIDATE_RATE_Get(Guid RateID)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.SelectCommand = new SqlCommand("HRM_CANDIDATE_RATE_Get");
				_dbadapter.SelectCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.SelectCommand.Connection = _dbconn;
				_dbadapter.SelectCommand.Parameters.Clear();
				_dbadapter.SelectCommand.Parameters.Add(new SqlParameter("@RateID", SqlDbType.UniqueIdentifier));
				_dbadapter.SelectCommand.Prepare();
				SqlGuid RateIDSQL = RateID;
				_dbadapter.SelectCommand.Parameters["@RateID"].Value = RateIDSQL;
				_dbadapter.Fill(_data);

				return _data;
			}
			catch (SqlException e)
			{
				throw new Exception("SQL Error: HRM_CANDIDATE_RATE_Get: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.SelectCommand != null)
					_dbadapter.SelectCommand.Dispose();
				CloseConnection();
			}
		}
		public DataSet HRM_CANDIDATE_RATE_GetListByCandidateCode(String CandidateCode)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.SelectCommand = new SqlCommand("HRM_CANDIDATE_RATE_GetListByCandidateCode");
				_dbadapter.SelectCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.SelectCommand.Connection = _dbconn;
				_dbadapter.SelectCommand.Parameters.Clear();
				_dbadapter.SelectCommand.Parameters.Add(new SqlParameter("@CandidateCode", SqlDbType.VarChar, 20));
				_dbadapter.SelectCommand.Prepare();
				SqlString CandidateCodeSQL = CandidateCode;
				_dbadapter.SelectCommand.Parameters["@CandidateCode"].Value = CandidateCodeSQL;
				_dbadapter.Fill(_data);

				return _data;
			}
			catch (SqlException e)
			{
				throw new Exception("SQL Error: HRM_CANDIDATE_RATE_GetListByCandidateCode: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.SelectCommand != null)
					_dbadapter.SelectCommand.Dispose();
				CloseConnection();
			}
		}
	}
}
